﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FileList.aspx.cs" Inherits="UDS.WebApp.SubModule.FileListPage" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
  <title>File List Page</title>
  <uds:Style runat="server" Href="~/css/BasicLayout.css" />
  <script type="text/javascript">
    //<!--
    function changeCatalog(list) {
      var opt = list.options[list.selectedIndex];
      window.location.href = "<%= Request.FilePath %>?CatalogID=" + opt.value;
    }
    //-->
  </script>
</head>
<body>
  <form method="post" runat="server">
  <uds:PageTitle runat="server" Title="公共下载" HintImage="~/images/icon/284.GIF">
    <TitlePanel>公共下载 &#187;
      <uds:CatalogDropDownList ID="listCatalog" runat="server" Width="120px" onchange="changeCatalog(this);" />
    </TitlePanel>
    <RightPanel>
      <asp:PlaceHolder runat="server" ID="phManagePanel" Visible="false">
        <uds:RedirectButton runat="server" Text="管理分类" CssClass="redbuttoncss optionbutton" RedirectUrl="Catalog.aspx" />
        <uds:RedirectButton runat="server" Text="新 增" CssClass="redbuttoncss optionbutton" RedirectUrl="AddFile.aspx" />
      </asp:PlaceHolder>
    </RightPanel>
  </uds:PageTitle>
  <uds:UDSDataGrid ID="dgFile" runat="server" DataKeyField="FileID" CssClass="datagrid fixedtable" OnPageIndexChanged="DataGrid_PageChanged">
    <Columns>
      <asp:TemplateColumn HeaderText="名称">
        <HeaderStyle Width="100%" />
        <ItemTemplate>
          <a href="<%# ((CFFileInfo)Container.DataItem).DownloadablePath %>" title="点击下载此文件">
            <%# HttpUtility.HtmlEncode( ((CFFileInfo)Container.DataItem).Name ) %>
          </a>
        </ItemTemplate>
      </asp:TemplateColumn>
      <asp:BoundColumn DataField="Version" HeaderText="版本">
        <HeaderStyle Width="60px" />
      </asp:BoundColumn>
      <asp:TemplateColumn HeaderText="上传日期">
        <HeaderStyle Width="100px" />
        <ItemTemplate>
          <%# Utility.FormatDate( ((CFFileInfo)Container.DataItem).LastModified ) %>
        </ItemTemplate>
      </asp:TemplateColumn>
      <asp:BoundColumn DataField="Catalog" HeaderText="类型">
        <HeaderStyle Width="100px" />
      </asp:BoundColumn>
      <asp:TemplateColumn HeaderText="是否作废">
        <HeaderStyle Width="80px" HorizontalAlign="Center" />
        <ItemStyle HorizontalAlign="Center" />
        <ItemTemplate>
          <%# ((CFFileInfo)Container.DataItem).Invalid ? "是" : "否" %>
        </ItemTemplate>
      </asp:TemplateColumn>
      <asp:TemplateColumn HeaderText="更新">
        <HeaderStyle Width="80px" HorizontalAlign="Center" />
        <ItemStyle HorizontalAlign="Center" />
        <ItemTemplate>
          <a href="UpdateFile.aspx?FileID=<%# ((CFFileInfo)Container.DataItem).FileID %>">更新</a>
        </ItemTemplate>
      </asp:TemplateColumn>
      <asp:TemplateColumn HeaderText="删除">
        <HeaderStyle Width="80px" HorizontalAlign="Center" />
        <ItemStyle HorizontalAlign="Center" />
        <ItemTemplate>
          <asp:LinkButton runat="server" CommandName="Delete" CommandArgument="<%# ((CFFileInfo)Container.DataItem).FileID %>" Text="删除" OnClientClick="if(true!==window.confirm('您确认要删除这些文件吗?')){return false;};" />
        </ItemTemplate>
      </asp:TemplateColumn>
    </Columns>
  </uds:UDSDataGrid>
  </form>
</body>
</html>
